<template>
  <el-input v-model="inputVal" placeholder="请输入内容" @blur="inputBlurEvent">
    <template #append>
      <el-button icon="el-icon-search" @click="findBtnClick"></el-button>
    </template>
  </el-input>
</template>

<script lang="ts">
import { computed, defineComponent } from 'vue'

export default defineComponent({
  props: {
    modelValue: String,
    inputBlurEvent: Function,
    findBtnClick: Function
  },
  setup(props, context) {
    const inputVal = computed({
      get: () => props.modelValue || '',
      set: val => { context.emit('update:modelValue', val) }
    })

    return { inputVal }
  },
})
</script>
